package com.by.envi;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;

import javax.sql.DataSource;

@Configuration
@SuppressWarnings("all")
public class SbtConfig {

	@Bean
	public PlatformTransactionManager transactionManager (DataSource dataSource) {
		//System.out.println(">>>>>>数据源:"+dataSource.toString());
		return new DataSourceTransactionManager(dataSource);
	}

	@Bean
	public Object testTransactionManager (PlatformTransactionManager transactionManager) {
		//System.out.println(">>>>>>事务管理器:"+transactionManager.getClass().getName());
		return new Object();
	}

}
